// MemDC.h: interface for the CMemDC class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_MEMDC_H__E0249B68_5FDF_4D2B_8436_26E7D5326602__INCLUDED_)
#define AFX_MEMDC_H__E0249B68_5FDF_4D2B_8436_26E7D5326602__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

class CMyMemDC : public CDC  
{
public:
    CMyMemDC(CDC* pDC, const CRect* pRect = NULL);
    virtual ~CMyMemDC();

    // Allow usage as a pointer 
    CMyMemDC* operator->() 
    {
        return this;
    }   

    // Allow usage as a pointer 
    operator CMyMemDC*() 
    {
        return this;
    }

private:    
    CBitmap  m_bmpDraw;    // Offscreen bitmap
    CBitmap *m_pOldBitmap; // bitmap originally found in CMemDC
    CDC     *m_pDC;        // Saves CDC passed in constructor
    CRect    m_rcDraw;     // Rectangle of drawing area.
    BOOL     m_bMemDC;     // TRUE if CDC really is a Memory DC.
    int      m_nWidth, m_nHeight;
    int      m_nLeft, m_nTop;
    DWORD    m_dwCount;
};

#endif // !defined(AFX_MEMDC_H__E0249B68_5FDF_4D2B_8436_26E7D5326602__INCLUDED_)
